<template>
<!-- 搜索框 -->
    <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="承运商" prop="carrier">
        <el-input
          v-model="queryParams.carrier"
          placeholder="请输入承运商"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="始发城市" prop="startCity">
        <el-input
          v-model="queryParams.startCity"
          placeholder="请输入始发城市"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="到货城市" prop="endCity">
        <el-input
          v-model="queryParams.endCity"
          placeholder="请输入到货城市"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="Search"  @click="handleQuery">搜索</el-button>
        <el-button icon="Refresh" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
</template>

<script lang="ts" setup>
 //接受父组件传入的参数
 let props = defineProps({
  queryParams:{
    type: Object,
    default: null
    },
    showSearch:{
      type: Boolean,
      default: true
    }
  }
)

let emits =  defineEmits(['handleQuery','resetQuery'])

let handleQuery = ()=>{
  emits('handleQuery')
}

let resetQuery = ()=>{
  emits('resetQuery')
}
</script>


<style scoped>

</style>
